from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
import time
testCase = "DBshop0014_商品管理管理分类商品分类删除分类"

firefox = openBrowser(urlAdmin) #打开后台网页
DBshopLoginAdmin(firefox)   #后台登录
DBshopEnterMenu3(firefox,"商品管理","管理分类","商品分类")
time.sleep(2)
# # 1.点击分类名称为“商品分类测试”后方的删除分类"链接
firefox.find_element_by_xpath("//td[contains(.,'商品分类测试')]/following-sibling::td[4]/a[3]").click()
time.sleep(2)
firefox.switch_to_alert().accept()
time.sleep(5)

try:
    firefox.find_element_by_xpath("//td[contains(.,'商品分类测试')]").is_displayed()
    # firefox.find_element_by_xpath('//td[contains(.,"%s")]' % goodsClassName).is_displayed()
    writeLog("%s 测试失败"%testCase)
    getPhoto(firefox)
except:
    writeLog("%s 测试通过" % testCase)
firefox.quit()